package com.fakepath.utils;

import android.content.Context;

public class ViewUtils {
	public static final int HALF_ALPHA = 128;
	public static final int OPAQUE_ALPHA = 255;
	private static Float displayDensity;

	public static int dipToPx(Context paramContext, float paramFloat) {
		return roundUp(paramFloat * getDisplayDensity(paramContext));
	}

	private static float getDisplayDensity(Context paramContext) {
		if (displayDensity == null)
			displayDensity = Float.valueOf(paramContext.getResources()
					.getDisplayMetrics().density);
		return displayDensity.floatValue();
	}

	public static int roundUp(float paramFloat) {
		return (int) (0.5F + paramFloat);
	}

}
